/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "establishmentmean")
@NamedQueries({
    @NamedQuery(name = "Establishmentmean.findAll", query = "SELECT e FROM Establishmentmean e"),
    @NamedQuery(name = "Establishmentmean.findByIdestablishmentmean", query = "SELECT e FROM Establishmentmean e WHERE e.idestablishmentmean = :idestablishmentmean"),
    @NamedQuery(name = "Establishmentmean.findByEstablishmentmean", query = "SELECT e FROM Establishmentmean e WHERE e.establishmentmean = :establishmentmean")})
public class Establishmentmean implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idestablishmentmean")
    private Integer idestablishmentmean;
    @Basic(optional = false)
    @Column(name = "establishmentmean")
    private String establishmentmean;
    @OneToMany(mappedBy = "establishmentmean", fetch = FetchType.LAZY)
    private List<Occurrenceelement> occurrenceelementList;

    public Establishmentmean() {
    }

    public Establishmentmean(Integer idestablishmentmean) {
        this.idestablishmentmean = idestablishmentmean;
    }

    public Establishmentmean(Integer idestablishmentmean, String establishmentmean) {
        this.idestablishmentmean = idestablishmentmean;
        this.establishmentmean = establishmentmean;
    }

    public Integer getIdestablishmentmean() {
        return idestablishmentmean;
    }

    public void setIdestablishmentmean(Integer idestablishmentmean) {
        this.idestablishmentmean = idestablishmentmean;
    }

    public String getEstablishmentmean() {
        return establishmentmean;
    }

    public void setEstablishmentmean(String establishmentmean) {
        this.establishmentmean = establishmentmean;
    }

    public List<Occurrenceelement> getOccurrenceelementList() {
        return occurrenceelementList;
    }

    public void setOccurrenceelementList(List<Occurrenceelement> occurrenceelementList) {
        this.occurrenceelementList = occurrenceelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idestablishmentmean != null ? idestablishmentmean.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Establishmentmean)) {
            return false;
        }
        Establishmentmean other = (Establishmentmean) object;
        if ((this.idestablishmentmean == null && other.idestablishmentmean != null) || (this.idestablishmentmean != null && !this.idestablishmentmean.equals(other.idestablishmentmean))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Establishmentmean[idestablishmentmean=" + idestablishmentmean + "]";
    }

}
